package com.chinacoal.microservice.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.chinacoal.microservice.pojo.CcmsSmartleasingCoefficientTemplate;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 费用系数表-mybatis-plus接口类
 * @date 2020-11-25 20：24
 */
public interface CcmsSmartleasingCoefficientTemplateMapper extends BaseMapper<CcmsSmartleasingCoefficientTemplate> {

    /**
     * @Description: 终止费用模板
     * @author zhuliang
     * @date 2020/11/26 15:25
     */
    void updateStatusById(@Param("lastUpdatedBy") Integer lastUpdatedBy,
                          @Param("lastUpdateDate")Date lastUpdateDate,
                          @Param("costFactorStatus") Integer costFactorStatus,
                          @Param("pkCoefficientTemplateId") String pkCoefficientTemplateId);

    /**
     * @Description: 查询所有的系数消息
     * @author zhuliang
     * @date 2020/11/30 19:21
     */
    List<CcmsSmartleasingCoefficientTemplate> getAll();

    /**
     * @Description: 根据模板名称查询模板id
     * @author zhuliang
     * @date 2021/1/25 17:07
     */
    String getIdByName(@Param("coefficientName") String coefficientName);

    /**
     * 根据费用ID查垃圾管理费
     * @param fkExpenseManagId 费用ID
     * @return
     */
    CcmsSmartleasingCoefficientTemplate selectGarbageDisposalFee(@Param("fkExpenseManagId") String fkExpenseManagId);

    /**
     * 修改系数模板时垃圾处理费为空时将其插入表中
     * @param pkCoefficientTemplateId 模板ID
     */
    void updateGarbageDisposalFeeToNull(@Param("pkCoefficientTemplateId") String pkCoefficientTemplateId);

    /**
     * 修改系数模板时电梯费单价为空时将其插入表中
     * @param pkCoefficientTemplateId 模板ID
     */
    void updateUnitPriceElevatorFeeToNull(@Param("pkCoefficientTemplateId") String pkCoefficientTemplateId);

    /**
     * 修改系数模板时卫生费为空时将其插入表中
     * @param pkCoefficientTemplateId 模板ID
     */
    void updateSanitationFeeToNull(@Param("pkCoefficientTemplateId") String pkCoefficientTemplateId);

    /**
     * 修改系数模板时本体维修基金为空时将其插入表中
     * @param pkCoefficientTemplateId 模板ID
     */
    void updateMaintenanceFundToNull(@Param("pkCoefficientTemplateId") String pkCoefficientTemplateId);

    /**
     * 修改系数模板时电视费/煤保为空时将其插入表中
     * @param pkCoefficientTemplateId 模板ID
     */
    void updateGasInsuranceToNull(@Param("pkCoefficientTemplateId") String pkCoefficientTemplateId);

    /**
     * 根据费用id查询绑定房间号的建筑面积
     * @param fkExpenseManagId 费用ID
     * @return
     */
    BigDecimal selectConstructionAreaByExpenseManagId(@Param("fkExpenseManagId") String fkExpenseManagId);
}
